import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/LoginView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: LoginView
    },
    {
        path: '/about',
        name: 'about',
        component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    },
    {
        path: '/home',
        name: 'home',
        component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue'),
        children: [
            {
                path: '/home/index',
                component: () => import('../views/IndexView.vue')
            },
            {
                path: '/home/activity-list',
                component: () => import('../views/activity/ActivityListView.vue')
            },
            {
                path: '/home/activity-add-new',
                component: () => import('../views/activity/ActivityAddNewView.vue')
            },
            {
                path: '/home/activity-prize',
                component: () => import('../views/activity/ActivityPrizeView.vue')
            },
            {
                path: '/home/activity-rule-list',
                component: () => import('../views/rule/RuleListView.vue')
            },
            {
                path: '/home/activity-rule-add-new',
                component: () => import('../views/rule/RuleAddNewView.vue')
            },
            {
                path: '/home/activity-rule-bing',
                component: () => import('../views/activity/ActivityRuleView.vue')
            },
            {
                path: '/home/prize-list',
                component: () => import('../views/prize/PrizeListView.vue')
            },
            {
                path: '/home/prize-add-new',
                component: () => import('../views/prize/PrizeAddNewView.vue')
            },
            {
                path: '/user-list',
                component: () => import('../views/log/OperateLogView.vue')
            }
        ]
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
